package edu.sju.chenshu.system.controller.user;

import edu.sju.chenshu.common.core.domain.Result;
import edu.sju.chenshu.common.core.domain.TableDataInfo;
import edu.sju.chenshu.system.domain.question.dto.UserDTO;
import edu.sju.chenshu.system.domain.user.dto.UserQueryDTO;
import edu.sju.chenshu.system.service.user.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private IUserService userService;

    @GetMapping("/list")
    public TableDataInfo list(UserQueryDTO userDTO) {
        return userService.list(userDTO);
    }

    @PutMapping("/updateStatus")
    public Result<Void> updateStatus(@RequestBody UserDTO userDTO) {
        //todo 拉黑：限制用户操作限制 解禁：放开用户操作限制
        return userService.updateStatus(userDTO);
    }
}
